//vue全家桶
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'

//引入依赖
import iView from 'iview';
import 'iview/dist/styles/iview.css';
import VueWechatTitle from 'vue-wechat-title';
import gallery from 'img-vuer';
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
import 'swiper/dist/css/swiper.css';

//全局注册axios，使用方法为:this.$axios
Vue.prototype.$axios = axios;
Vue.use(router);
Vue.use(iView);
Vue.use(VueWechatTitle);
Vue.use(gallery);
Vue.use(mavonEditor);

Vue.config.productionTip = false;
// 打包代理处理——————————————————————————————————————————————————————————
axios.defaults.timeout = 5000;// 请求超时
// 本地开发配置
axios.defaults.baseURL = '/api/'; // api 即上面 vue.config.js 中配置的地址
Vue.prototype.$src = '/api/';//全局注册图片加载地址
// 打包上线配置——————————————————————————————————————————————————————————
// axios.defaults.baseURL = 'http://tianxiaotian.xyz:80/';//api前缀
// Vue.prototype.$src = 'http://tianxiaotian.xyz:80/';//全局注册图片加载地址
// ————————————————————————————————————————————————————————————————————
new Vue({
  iView,
  router,
  store,
  render: h => h(App)
}).$mount('#app');
//图片预览
Vue.use(gallery, {
  swipeThreshold: 80, // 滑动阈值，默认值 100
  isIndexShow: true, // 是否显示图片序号
  useCloseButton: false, // 只通过右上角关闭键退出浏览
  preload: true, // 预加载同组图片
});
